﻿using Quartz;
using Warehouse.Application.Services.Libraryrecord;

namespace Warehouse.Api
{
    public class RedisCacheRefreshJob : IJob
    {
        private readonly ILibraryrecordAppService _libraryrecordAppService;

        public RedisCacheRefreshJob(ILibraryrecordAppService libraryrecordAppService)
        {
            _libraryrecordAppService = libraryrecordAppService;
        }

        public async Task Execute(IJobExecutionContext context)
        {
            await _libraryrecordAppService.RefreshRedisCacheDaily();
            Console.WriteLine($"Redis缓存刷新任务执行完成: {DateTime.Now}");
        }
    }
}